<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
  {{info}}
  <ul>
    <!--v-for循环遍历指令,遍历的过程中创建当前元素以及子元素-->
    <li v-for="name in arr">{{name}}</li>
  </ul>
  <table border="1">
    <caption>商品表</caption>
    <tr>
      <th>编号</th><th>商品标题</th><th>商品价格</th><th>商品库存</th>
    </tr>
    <tr v-for="(p,i) in products">
      <td>{{i+1}}</td><td>{{p.title}}</td><td>{{p.price}}</td><td>{{p.num}}</td>
    </tr>
  </table>
</div>
<script src="js/vue.min.js"></script>
<script>
  let v = new Vue({
    el:"body>div",
    data:{
      info:"循环遍历",
      arr:["张三","李四","王五"],
      products:[{title:"小米手机",price:3000,num:200},
        {title:"李宁篮球鞋",price:500,num:100},
        {title:"华为电视",price:5000,num:300}]
    }
  })
</script>
</body>
</html>